<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/template/template2.xhtml">
	<ui:define name="header">
	     <div id="menu">
			<ul>
				<li><h:outputLink value="admin.xhtml"><h:outputText value="#{msg.home}"/></h:outputLink></li>
				<li><h:outputLink value="cadastro.xhtml"><h:outputText value="#{msg.cadastrar}"/></h:outputLink></li>
				<li><h:outputLink value="remover.xhtml"><h:outputText value="#{msg.remover}"/></h:outputLink></li>
				<li class="current_page_item"><h:outputLink value="alterar.xhtml"><h:outputText value="#{msg.alterar}"/></h:outputLink></li>
				<li><h:outputLink value="lrecados.xhtml"><h:outputText value="#{msg.recados}"/></h:outputLink></li>
				<li><h:outputLink value="mensagem.xhtml"><h:outputText value="#{msg.mensagem}"/></h:outputLink></li>
				<li><h:commandLink action="#{LoginBean.sair}"><h:outputText value="#{msg.encerrar}"/></h:commandLink></li>
			</ul>
		</div>
	</ui:define>
	<ui:define name="content">
	<p:growl/>
	    <h:form>
	    <p:fieldset legend="#{msg.altusu}" toggleable="true" toggleSpeed="500" collapsed="true">  
	    	<h:panelGrid columns="2" border="0" >
				<h:outputText value="#{msg.cpf}: " />
				<p:inputText style="width:300px" value="#{UsuarioBean.CPF}">
					<f:converter converterId="CpfConverter"/>
					<p:ajax event="change" listener="#{UsuarioBean.pesquisarUsuario}" update="email,endereco,usuario,senha,nome,tel1,tel2"/>
				</p:inputText>
				
		   		<h:outputLabel value="#{msg.email}: " />
		   		<p:inputText  id="email" style="width:300px" value="#{UsuarioBean.email}">
		   			<f:validator validatorId="EmailValidator"/>
		   		</p:inputText>

				<h:outputText value="#{msg.endereco}: " />
				<p:inputText id="endereco" style="width:300px" value="#{UsuarioBean.endereco}" />
				
				<h:outputText value="#{msg.usuario}: " />
				<p:inputText id="usuario" style="width:300px" value="#{UsuarioBean.usuario}">
					<f:converter converterId="LowerCaseConverter"/>
					<f:validator validatorId="TamanhoValidator"/>
				</p:inputText>
				
				<h:outputText value="#{msg.senha}: " />
				<p:password inline="true" weakLabel="#{msg.fraco}" goodLabel="#{msg.bom}" strongLabel="#{msg.forte}" id="senha" redisplay="true" promptLabel="#{msg.insirasenha}" style="width:300px" value="#{UsuarioBean.senha}" />
				
				<h:outputText value="#{msg.nome}: " />
				<p:inputText id="nome" style="width:300px" value="#{UsuarioBean.nome}">
					<f:validator validatorId="TamanhoValidator"/>
				</p:inputText>
				
				<h:outputText value="#{msg.tel1}: " />
				<p:inputText id="tel1" style="width:300px" value="#{UsuarioBean.tel1}"  />

				<h:outputText value="#{msg.tel2}: " />
				<p:inputText id="tel2" style="width:300px" value="#{UsuarioBean.tel2}"  />
			
				<h:outputText />
				<h:panelGroup>
					<div style="text-align: right;">
						<h:commandButton value="#{msg.limpar}" type="reset" />
						<h:commandButton value="#{msg.enviar}" type="submit" action="#{UsuarioBean.alterarUsuario}"/>
					</div>
				</h:panelGroup>
			</h:panelGrid>
	    </p:fieldset>
	    </h:form>
	    
	    <br/>
	    
	    <h:form>
	    <p:fieldset legend="#{msg.altcat}" toggleable="true" toggleSpeed="500" collapsed="true"> 
	    	<h:panelGrid columns="3" border="0" >
	    		<h:outputText value="#{msg.categoria}: " />
				<h:panelGroup>
					<h:selectOneMenu style="width:300px;" value="#{CategoriaBean.nome}">
						<f:selectItem itemLabel="Escolha a Categoria" itemValue="branco"/>
						<f:selectItems value="#{CategoriaBean.listarCategoriass}" var="categoria" itemLabel="#{categoria.nome}" itemValue="#{categoria.nome}"/>
					</h:selectOneMenu>
				</h:panelGroup> 
				<h:outputText/>
				
				<h:outputText value="#{msg.novonome}: "/>
				<p:inputText id="nome1" style="width:290px" value="#{CategoriaBean.nome1}" required="true" requiredMessage="*Campo Obrigatório.">
					<f:validator validatorId="TamanhoValidator"/>
				</p:inputText>
				<h:message for="nome1" errorStyle="color:red"/>
				
				<h:outputText/>
				<h:panelGroup>
					<div style="text-align: right;">
						<h:commandButton value="#{msg.alterar}" type="submit" action="#{CategoriaBean.alterarCategoria}" />
					</div>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>
	    </p:fieldset>
	    </h:form>
	    
	    <br/>
	    
	    <h:form>
	    <p:fieldset legend="#{msg.altfilme}" toggleable="true" toggleSpeed="500" collapsed="true"> 
	    	<h:panelGrid columns="2" border="0" >
	    		<h:outputText value="#{msg.titulo}: " />
				<h:panelGroup>
					<h:selectOneMenu style="width:308px;" value="#{FilmeBean.titulo1}"  >
						<f:selectItem itemLabel="Escolha a Filme" itemValue="branco"/>
						<f:selectItems value="#{FilmeBean.listarFilme}" var="filme" itemLabel="#{filme.titulo}" itemValue="#{filme.titulo}"/>
					</h:selectOneMenu>
				</h:panelGroup> 
				
				<h:outputText value="#{msg.novonome}: "/>
				<p:inputText style="width:300px" value="#{FilmeBean.titulo}"  />
				
				<h:outputText value="#{msg.novoano}: "/>
				<p:inputText style="width:300px" value="#{FilmeBean.ano}"  />
				
				<h:outputText value="#{msg.novacategoria}: "/>
				<h:panelGroup>
					<h:selectOneMenu style="width:308px;" value="#{FilmeBean.cat}"  >
						<f:selectItem itemLabel="Escolha a Categoria" itemValue="branco"/>
						<f:selectItems value="#{CategoriaBean.listarCategoriass}" var="categoria" itemLabel="#{categoria.nome}" itemValue="#{categoria.nome}"/>
					</h:selectOneMenu>
				</h:panelGroup>
				
				<h:outputText/>
				<h:panelGroup>
					<div style="text-align: right;">
						<h:commandButton value="#{msg.alterar}" type="submit" action="#{FilmeBean.alterarFilme}"/>
					</div>
				</h:panelGroup>
			</h:panelGrid>	 
	    </p:fieldset>
	    </h:form>
	    <div style="clear: both; height: 262px;">&nbsp;</div>
	</ui:define>
</ui:composition>
</html>